<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
  public function _initTranslator()
  {  
      $translator = new Zend_Translate('array', APPLICATION_PATH . '/lang/en.php', 'en');
      $translator->addTranslation(APPLICATION_PATH . '/lang/pl.php', 'pl');
      $translator->setLocale('pl');

      Zend_Registry::set('Zend_Translate', $translator);
  }
  
  public function _initApp()
  {
    // Zend_Controller_Router_Route::setDefaultTranslator(Zend_Registry::get('Zend_Translate'));
    
    $frontController = Zend_Controller_Front::getInstance();
    $router = $frontController->getRouter();
    $routes = new Zend_Config_Xml(APPLICATION_PATH . '/configs/routes.xml', APPLICATION_ENV);
    // $router->removeDefaultRoutes();
    $router->addConfig($routes, 'routes');
  }
  
  protected function _initView()
  {
    $this->bootstrap('layout');
    $layout = $this->getResource('layout');
    $view = $layout->getView();

    $view->doctype('HTML5');
    // $view->headMeta()->appendHttpEquiv('Content-Type', 'text/html;charset=utf-8');
    $view->headMeta()->setCharset('utf-8');    
    $view->headMeta()->setName('robots', 'index,follow');
    $view->headMeta()->setName('author', 'Jakub Kułak, www.webascrazy.net');
    $view->headTitle()->setSeparator(' - ');
    $view->headTitle('Dabster');

    $config = new Zend_Config_Xml(APPLICATION_PATH . '/configs/navigation.xml', APPLICATION_ENV);

    $view->navigation(new Zend_Navigation($config));
  }

}

